TextEdit in Forth
Volume Number: 1
Issue Number: 7
Column Tag: Forth Forum
By Jörg Langowski
Through the set of routines called TextEdit, the toolbox provides the basic
functions necessary for editing and formatting text: cutting, pasting, copying,
inserting, deleting and scrolling within windows.
You are already familiar with all of the functions supported by TextEdit, since
almost every application makes use of them, and selecting text with the mouse is one of
the basic principles of the Macintosh user interface.
In this column we shall set up a simple TextEdit (TE) record in a window under
MacForth and learn about some principles of TE.
TE basically forms an interface between an ASCII text and a GrafPort, the drawing
environment of QuickDraw. Given the port in which to display the text and some other
parameters, which I’ll soon explain, it will automatically draw the visible part of the
text on the screen. TE then also responds to mouse action like clicking and dragging by
moving the ‘insertion point’ (the blinking vertical line) and by highlighting the